from flask import render_template,redirect,url_for,session, flash
from flask_login import login_required, current_user
from flaskext.uploads import UploadSet, IMAGES

from controller import app
from lib.form import Form
from dao.picture import PictureDao
from model.picture import Picture
import os

app.config['UPLOADS_FOLDER'] = os.path.realpath('.') + '/static/'

class PicturesForm(Form):
    def __init__(self):
        '''Only accept POST request
        '''
        Form.__init__(self)

class PictureForm(Form):
    def __init__(self):
        '''Only accept POST request
        '''
        Form.__init__(self)
        if self.is_submitted():
            # If get fail, return None
            self.name = ''
            
            self.type = 0
                
            self.path = os.path.realpath('.') + '/static/' + self.name
            
            self.description = 'picture description'
            

